<div class="content-box"><!-- Start Content Box -->
    <div class="content-box-header">
        
        <h3>Danh sách đặt hàng</h3>
        
        <ul class="content-box-tabs">
       
            <li><a href="#tab1" class="default-tab">Table</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2">Forms</a></li>
        </ul>
        
        <div class="clear"></div>
        
    </div> <!-- End .content-box-header -->
    
    <div class="content-box-content">
   
        <div class="tab-content default-tab" id="tab1"><!-- This is the target div. id must match the href of this div's tab -->	
    <table id="cart-table" class="table table-bordered">
            <tr id="sort-row" data-base-url="/admin_vina/cart/all">
                <th>#</th>
                <th data-model="Cart" id="cart_created"><a href="#">Ngày</a></th>
                <th data-model="Cart" id="customer_name"><a href="#">Tên khách hàng</a></th>
                <th data-model="Cart" id="customer_phone" ><a href="#">Số điện thoại</a></th>
                <th data-model="Cart" id="customer_email" ><a href="#">Email</a></th>
                <th data-model="Cart" id="customer_address" ><a href="#">Địa chỉ</a></th>
                
                <th width="69" id="stock_name" data-model="Stock"><a href="#">Trạng thái</a></th>
                <th>!</th>
            </tr>
            <?php
            $i=1;
			$sql="SELECT 
								*
								FROM tbl_dathang
								
								ORDER BY id DESC";						
				$result=mysql_query($sql);
				$num=mysql_num_rows($result);
				if($num>0)
				{
					while($row=mysql_fetch_array($result))
						{
						?>
                            <tr class="info">
                                <td><?php echo $i++;?></td>
                                <td><?php echo date('d-m-Y H:i:s',strtotime($row['ngaydathang']));?></td>
                                <td><?php echo $row['tenkhachhang'];?></td>
                                <td>0<?php echo $row['sodt'];?></td>
                                <td><?php echo $row['email'];?></td>
                                <td><?php echo $row['diachi'];?></td>
                                
                                <td valign="middle"><?php if($row['trangthai']==0){echo 'Chưa phản hồi';}else{echo 'Đã gửi email phản hồi';};?></td>
                                <td><a href="index.php?page=cart&act=cart_edit&id=<?php echo $row['id'];?>">Xem</a></td>
                                
                            </tr>
						<?php
						}
				}
			?>
                    
    </table>
 		</div> <!-- End #tab1 -->
    </div> <!-- End .content-box-content -->
</div> <!-- End .content-box -->